/**
 * JAVACC DEMO 1.0
 * @copy right dwusoft company All rights reserved. 
 * @Package com.apache.bid.service.cacheplugins  
 */
package com.apache.bid.service.cacheplugins;

import com.apache.api.manager.PluginConnector;
import com.apache.api.vo.ParamsVo;
import com.apache.api.vo.ResultEntity;
import com.apache.bid.entity.BidItemVip;
import com.apache.bid.manager.BidItemVipManager;
import com.apache.cache.util.Validator;

/**
 * description:  删除itemVip信息
 * @author Hou Dayu 创建时间：2016-3-23  
 * 
 */
public class DelItemVipPluginImpl implements PluginConnector {

	private BidItemVipManager bidItemVipManager;

	/**
	 * TODO 简单描述该方法的实现功能（可选）.  
	 * @see com.zbxsoft.api.manager.PluginConnector#execute(com.zbxsoft.api.vo.ParamsVo)  
	 */
	public Object execute(ParamsVo param) throws Exception {
		String vipId = Validator.getDefaultStr(param.getInfoId(), String.valueOf(param.getParams("infoId")));
		ResultEntity entity = new ResultEntity();
		if (Validator.isNull(vipId)) {
			entity.setResult("false");
			entity.setMessage("缺少方法参数,方法执行失败");
		} else {
			ParamsVo<BidItemVip> vo = new ParamsVo<BidItemVip>();
			vo.setInfoId(vipId);
			boolean mark = bidItemVipManager.deleteInfo(vo);
			entity.setResult("true");
			entity.setMessage("删除用户级别信息成功");
			entity.setEntity(mark);
		}
		return entity;
	}

	public void setBidItemVipManager(BidItemVipManager bidItemVipManager) {
		this.bidItemVipManager = bidItemVipManager;
	}

}
